﻿@section title
{
    我的鲜享余额
}

@section pagetitle
{
    我的鲜享余额
}
@section header
{
    <link href="~/Themes/RongJi/Style/base/css/balance.css" rel="stylesheet" />
    <style>
        /*.pageHeaderMini {
            display: none;
        }*/
    </style>
}

@model RiderShop.Mobile.Modle.MyAccount.BalanceModel

@{
    decimal maxIncome = Model.BalanceIncomeHistory.Count > 0 ? Model.BalanceIncomeHistory.Max(h => h.AdditionalIncome) * 1.3M : 1M;
}

<div class="bs-example bs-example-tabs" role="tabpanel" data-example-id="togglable-tabs">
    <ul id="myTab" class="nav nav-tabs" role="tablist">
        <li role="presentation" class="dropdown active">
            <a href="#" id="myTabDrop1" class="dropdown-toggle" data-toggle="dropdown" aria-controls="myTabDrop1-contents" aria-expanded="false">请选择收益时段 <span class="caret"></span></a>
            <ul class="dropdown-menu" role="menu" aria-labelledby="myTabDrop1" id="myTabDrop1-contents">
                @*<li class="active">
                        <a href="#dropdown1" tabindex="-1" role="tab" id="dropdown1-tab" data-toggle="tab" aria-controls="dropdown1" aria-expanded="true">万份收益</a>
                    </li>*@
                <li>
                    <a href="#dropdown2" tabindex="-1" role="tab" id="dropdown2-tab" data-toggle="tab" aria-controls="dropdown2" aria-expanded="true">累计收益</a>
                </li>
                <li>
                    <a href="#dropdown3" tabindex="-1" role="tab" id="dropdown3-tab" data-toggle="tab" aria-controls="dropdown3" aria-expanded="false">近一周收益</a>
                </li>
                <li>
                    <a href="#dropdown4" tabindex="-1" role="tab" id="dropdown4-tab" data-toggle="tab" aria-controls="dropdown4" aria-expanded="false">近一月收益</a>
                </li>
            </ul>
        </li>
    </ul>
    <div id="myTabContent" class="tab-content mb30">
        @*<div role="tabpanel" class="tab-pane fade active in" id="dropdown1" aria-labelledby="dropdown1-tab">

                <div class="profitWrapper">
                    <header class="profitListHeader">
                        <em>万份收益(元)</em>
                        1.1235
                    </header>
                    <ul class="profitList">
                        <li>
                            <span class="latest">2015-05-05 <em>0.13</em></span>
                        </li>
                        <li>
                            <span>2015-05-04 <em>0.13</em></span>
                        </li>
                        <li>
                            <span>2015-05-03 <em>0.13</em></span>
                        </li>
                        <li>
                            <span>2015-05-02 <em>0.13</em></span>
                        </li>
                        <li>
                            <span>2015-05-01 <em>0.13</em></span>
                        </li>
                    </ul>
                </div>
            </div>*@

        <div role="tabpanel" class="tab-pane fade active in" id="dropdown2" aria-labelledby="dropdown2-tab">
            <div class="profitWrapper">
                <header class="profitListHeader">
                    <em>累计收益(元)</em>
                    @Model.BalanceAccount.TotalIncome.ToString("N2")
                </header>
                <ul class="profitList">

                    @for (int i = 0; i < @Model.BalanceIncomeHistory.Where(h => h.OperateDate > DateTime.Now.AddDays(-7)).ToList().Count; i++)
                    {
                        var history = @Model.BalanceIncomeHistory[i];

                        <li>
                            <span @(i == 0 ? "class=latest" : "") style="width:@((history.AdditionalIncome*100/maxIncome).ToString("N0")+"%")">
                                @history.OperateDate.ToString("yyyy-MM-dd")
                            </span>
                            <em>@history.AdditionalIncome.ToString("N2")</em>
                        </li>
                    }
                </ul>
            </div>
        </div>

        <div role="tabpanel" class="tab-pane fade" id="dropdown3" aria-labelledby="dropdown3-tab">
            <div class="profitWrapper">
                <header class="profitListHeader">
                    <em>近一周收益(元)</em>
                    @Model.BalanceIncomeHistory.Where(h => h.OperateDate > DateTime.Now.AddDays(-7)).Sum(h => h.AdditionalIncome).ToString("N2")
                </header>
                <ul class="profitList">
                    @for (int i = 0; i < @Model.BalanceIncomeHistory.Where(h => h.OperateDate > DateTime.Now.AddDays(-7)).ToList().Count; i++)
                    {
                        var history = @Model.BalanceIncomeHistory[i];

                        <li>
                            <span @(i == 0 ? "class=latest" : "") style="width:@((history.AdditionalIncome*100/maxIncome).ToString("N0")+"%")">
                                @history.OperateDate.ToString("yyyy-MM-dd")
                            </span>
                            <em>@history.AdditionalIncome.ToString("N2")</em>
                        </li>
                    }
                </ul>
            </div>
        </div>

        <div role="tabpanel" class="tab-pane fade" id="dropdown4" aria-labelledby="dropdown4-tab">
            <div class="profitWrapper">
                <header class="profitListHeader">
                    <em>近一月收益(元)</em>
                    @Model.BalanceIncomeHistory.Sum(h => h.AdditionalIncome).ToString("N2")
                </header>
                <ul class="profitList">
                    @for (int i = 0; i < @Model.BalanceIncomeHistory.ToList().Count; i++)
                    {
                        var history = @Model.BalanceIncomeHistory[i];

                        <li>
                            <span @(i == 0 ? "class=latest" : "") style="width:@((history.AdditionalIncome*100/maxIncome).ToString("N0")+"%")">
                                @history.OperateDate.ToString("yyyy-MM-dd")
                            </span>
                            <em>@history.AdditionalIncome.ToString("N2")</em>
                        </li>
                    }
                </ul>
            </div>
        </div>

    </div>
</div>

@section footer
{

}